package com.ht.searchrooky.service;

import java.util.List;

import javax.inject.Inject;

import org.springframework.stereotype.Service;
import org.springframework.util.Assert;

import com.ht.searchrooky.dao.UserDao;
import com.ht.searchrooky.domain.User;

@Service
public class UserServiceImpl implements UserService {
	
	@Inject
 	private UserDao userDao;

	@Override
	public User getUserByName(String user) {
		return userDao.getUserByName(user);
	}

	@Override
	public User getUserById(int uid) {
		Assert.isNull(uid);
		if (uid<=0) {
			return null;
		}
		return userDao.getUserById(uid);
	}

	@Override
	public void deletUser(User user) {
		 userDao.deletUser(user);
	}

	@Override
	public List<User> getUserList() {
		// TODO Auto-generated method stub
		return userDao.getUserList();
	}

	@Override
	public User updateUser(User user) {
		// TODO Auto-generated method stub
		return userDao.updateUser(user);
	}

	
}
